<?php
	DEFINE('H1', 'Read XML Books');
	DEFINE('TITLE','Read XML Books');
	require('includes/header.php');
?>	
	<h2><?PHP echo H1 ?></h2>

<?php
	$xml=simplexml_load_file("misc/library.xml") or die("Cannot read XML");

	foreach($xml->book as $book){
		echo "<u><b>" . $book->title . "</b></u>" . " Author: " . $book->author . " (" . $book->pages . " pages)" . "<br />" . "\n";
		echo "<ul><li>Genre: " . $book['genre'] . "</li> \n";
		echo "<li>Rating: " . $book['rating'] . " Stars </li></ul> \n";
		}


?>

<?php
	require('includes/footer.php');
?>